﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InputManager : MonoBehaviour
{

    public bool UseKeyboardInput;

    public KeyCode Left = KeyCode.LeftArrow;
    public KeyCode Right = KeyCode.RightArrow;
    public KeyCode Up = KeyCode.UpArrow;
    public KeyCode Down = KeyCode.DownArrow;

    public KeyCode PunchKey = KeyCode.Z;


    public delegate void InputEventHandler(int key);
    public static event InputEventHandler onInputEvent;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        //按键
        if (UseKeyboardInput) KeyboardControls();

        //手柄

        //触摸
    }
    void KeyboardControls()
    {
        if (Input.GetKey(Left))
        {
            // onInputEvent(1);
        }
        if (Input.GetKey(Right))
        {
            // onInputEvent(0);
        }
        if (Input.GetKey(Up))
        {

        }
        if (Input.GetKey(Down))
        {

        }
        if (Input.GetKey(PunchKey))
        {

        }

    }
}
